package G;

import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
        int[] a = {1, 3, 2, 4};
        int[] b = new int[a.length];

        Arrays.sort(a);   // 将数组a的内容由小到大排序

        // 将数组a的内容从后到前拷贝到数组b中
        for (int i = 0; i < a.length; i ++) {
            b[a.length -1 - i] = a[i];
        }

        System.arraycopy(b, 0, a, 0, a.length);  // 将数组b的内容拷贝到数组a中

        System.out.println("content in array a:");
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + ",");
        }
        System.out.println();
    }
}
